import java.util.Arrays;

public class Test2 {
    //数组的定义与使用
    //一般通过new关键字来实例化对象
    //JAVA当中的数组其实就是一个对象
    //java当中一切皆是对象
    //数组是引用类型
    //

    public static void main(String[] args) {
        int[] array = {1,2,32,14,5,56};
        for (int i = 0; i <array.length ; i++) {
            System.out.println(array[i]);//通过下标访问的
        }
        System.out.println("===================");
        for(int x : array){//和下标没有关系
            System.out.println(x);
        }
        System.out.println("=======================");
        Arrays.sort(array);//按大小顺序打印
        String ret = Arrays.toString(array);
        System.out.println(ret);
    }

    public static void main3(String[] args) {
        int[] array = {1,2,3,4,5,6};
        array[0] = 99;
        System.out.println(array[0]);
        System.out.println(array.length);
        //

    }

    public static void main2(String[] args) {
        boolean[] array = new boolean[10];
        char[] array1 = new char[10];//'\u0000'
        System.out.println("=========");
    }

    public static void main1(String[] args) {
        boolean[] array5 =new boolean[10];
        char[] array6 = new char[10];
        String str = new String("hello");
        String str2 = "asdf";


        int[] array = {1,2,3,4,5,6};
        int[] array2 = new int[]{1,2,3,4,5,6};
        int[] array3 = new int[10];

        int[] array4;
        array4 = new int[]{1,2,3,4};


    }
}
